package week06;
/*
import java.util.Scanner;

class ArrayUtils{
	static class PairResult{
		private double min;
		private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
		
	}
	
	static PairResult findMinMax(double[] values){
		double max=0, min=0;
		for(int i = 0 ; i  < values.length; i ++){
			if(max < values[i])
				max = values[i];
			if(min > values[i])
				min = values[i];
		}
		PairResult pr = new PairResult();
		pr.max = max;
		pr.min = min;
		return pr;
	}
}

public class Main3 {

	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double[] d = new double[n];
		for(int i = 0 ; i < n ; i++ )
			d[i] = sc.nextDouble();
		System.out.println(ArrayUtils.findMinMax(d).toString());
		System.out.println(ArrayUtils.PairResult.class);
	}
	
}*/

import java.util.Scanner;

class ArrayUtils{

PairResult findMinMax(double[]values){
	PairResult pair=new PairResult(values[0],values[0]);
	for(int i=1;i<values.length;i++){
		if(values[i]>pair.max)
			pair.max=values[i];}
	for(int i=1;i<values.length;i++){
		if(values[i]<pair.min)
			pair.min=values[i];}
	System.out.println(pair.toString());
	return pair;

}

class PairResult{

private double min;
private double max;

public PairResult(double min,double max)
	{this.min=min;this.max=max;}

	@Override 
	public String toString(){return "PairResult ["+"min="+min+", max="+max+']';}}}

public class Main3 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayUtils u = new ArrayUtils();
		double[] num = new double[n];
		for (int i = 0; i < n; i++) {
			num[i] = sc.nextDouble();
		}
		u.findMinMax(num);
		System.out.println(ArrayUtils.PairResult.class);
	}
}
